/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author lory
 */
 
import java.util.ArrayList;
import java.util.Iterator;

public class ListaPdf implements Lista {
        
    ArrayList listaPdf;
    int numeroPdf;
    
    public ListaPdf() {
        listaPdf = new ArrayList();
        numeroPdf = 0;
    }
    
    public void add
            (Object object) {
        Pdf pdf = (Pdf)object;
        listaPdf.add(pdf);
        numeroPdf ++;
    }
    
    public Object get() {
        Pdf pdf = (Pdf) listaPdf.get(0);
        System.out.println(pdf.getNome()+" "+pdf.getPagine()+" "
                +pdf.getNumeroCopie()+" "+pdf.getCliente()+" \n");
        return pdf;
    }
    
    public Iterator createIterator() {
        Iterator pdfIterator = new PdfIterator(listaPdf);
        return pdfIterator;
    }
    
    public int length() {
        return listaPdf.size();
    }

    public int getNumero() {
        return this.numeroPdf;
    }
    
}
